﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Core.Battle.AbilityBehavior
{
    public class Instant : IAbilityBehavior
    {
        EntityChangeValue change;
        int damage;
        public Instant(int damage, EntityChangeValue changeValue)
        {
            this.damage = damage;
            change = changeValue;
        }

        public void Apply(IEntity speller, IEnumerable<IEntity> targets)
        {
            foreach (var target in targets)
            {
                switch (change)
                {
                    case EntityChangeValue.HP:
                        target.HP += damage;
                        Console.WriteLine($"{speller.Name} cast 改变{change} to {target.Name}, damage {damage}");
                        break;

                    case EntityChangeValue.Shield:
                        target.Shield += damage;
                        break;

                    default:
                        break;
                }
            }
        }
    }
}
